home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 November: Tool Chest / Dev.CD Nov 00 TC Disk 2.toast / pc / sample code / sound / sndplaydoublebuffer / _headers / myaiff.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-09-28  |  2.3 KB  |  88 lines

  1. /*
  2.     File:        MyAIFF.h
  3.  
  4.     Contains:    Headers for routines demonstrating how to parse an AIFF sound header.
  5.  
  6.     Written by: Mark Cookson    
  7.  
  8.     Copyright:    Copyright © 1996-1999 by Apple Computer, Inc., All Rights Reserved.
  9.  
  10.                 You may incorporate this Apple sample source code into your program(s) without
  11.                 restriction. This Apple sample source code has been provided "AS IS" and the
  12.                 responsibility for its operation is yours. You are not permitted to redistribute
  13.                 this Apple sample source code as "Apple sample source code" after having made
  14.                 changes. If you're going to re-distribute the source, we require that you make
  15.                 it clear in the source that the code was descended from Apple sample source
  16.                 code, but that you've made changes.
  17.  
  18.     Change History (most recent first):
  19.                 8/31/1999    Karl Groethe    Updated for Metrowerks Codewarror Pro 2.1
  20.                 
  21.  
  22. */
  23.  
  24. #ifndef __MyAIFF__
  25. #define __MyAIFF__
  26.  
  27. #include <AIFF.h>
  28. #include <Errors.h>
  29. #include <Files.h>
  30. #include <Sound.h>
  31.  
  32. #ifndef __DBFFERRORS__
  33. #include "DBFF_Errors.h"
  34. #endif
  35.  
  36. #ifndef __SETUPDBHEADER__
  37. #include "SetupDBHeader.h"
  38. #endif
  39.  
  40. #ifndef __LDANDFIX__
  41. #include "LDandFix.h"
  42. #endif
  43.  
  44. #ifndef __DEFINES__
  45. #include "Defines.h"
  46. #endif
  47.  
  48. #define kChunkBufferSize     128
  49. #define kChunkHeaderSize    8
  50.  
  51. /* these are bit positions for a long flag */
  52. #define kFORM                    (1<<0)
  53. #define kFormatVersion            (1<<1)
  54. #define kCommon                    (1<<2)
  55. #define kSoundData                (1<<3)
  56. #define kMarker                    (1<<4)
  57. #define kInstrument                (1<<5)
  58. #define kMIDIData                (1<<6)
  59. #define kAudioRecording            (1<<7)
  60. #define kApplicationSpecific    (1<<8)
  61. #define kComment                (1<<9)
  62. #define kName                    (1<<10)
  63. #define kAuthor                    (1<<12)
  64. #define kCopyright                (1<<13)
  65. #define kAnnotation                (1<<14)
  66.  
  67. typedef union {
  68.     ChunkHeader                    generic;
  69.     ContainerChunk                container;
  70.     FormatVersionChunk            formatVersion;
  71.     CommonChunk                    common;
  72.     ExtCommonChunk                extCommon;
  73.     SoundDataChunk                soundData;
  74.     MarkerChunk                    marker;
  75.     InstrumentChunk                instrument;
  76.     MIDIDataChunk                midiData;
  77.     AudioRecordingChunk            audioRecording;
  78.     CommentsChunk                comments;
  79.     TextChunk                    text;
  80. } ChunkTemplate, *ChunkTemplatePtr;
  81.  
  82. #define stillMoreDataToRead        ((chunkFlags & kFORM) && (!(chunkFlags & kCommon) || !(chunkFlags & kSoundData)) && (err == noErr))
  83.  
  84. OSErr    ASoundGetAIFFHeader        (SoundInfoPtr theSoundInfo,
  85.                                 long *dataStart,
  86.                                 long *length);
  87.  
  88. #endif